﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DCHealthCheck.MvcWeb.Classes.ViewModels.ReplicationNeighborViewModel>" %>
<%@ Import Namespace="DCHealthCheck.MvcWeb.Classes" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <%:Global.ApplicationName%>::<%:Model.ControllerName%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="infobox">
        <%Html.RenderPartial("DateFilterControl"); %>
        <%Html.RenderPartial("DomainFilterControl"); %>
        <%Html.RenderPartial("SourceServerFilterControl"); %>
        <%Html.RenderPartial("PartitionNameFilterControl"); %>
        <%Html.RenderPartial("ReplicationReasonFilterControl"); %>
    </div>
    <div id="contents">
        <div id="leftcontainer">
            <%Html.RenderPartial("TableHeader", this.Model); %>
            <%Html.RenderPartial("ReplicationNeighborsTable", this.Model); %>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptsSection" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {

            $("#searchForm").append('<input type="hidden" name="sourceServer" value="<%:Model.SourceServer%>" id="hiddenSourceServer" />');
            $("#searchForm").append('<input type="hidden" name="partitionName" value="<%:Model.PartitionName%>" id="hiddenPartitionName" />');
            $("#searchForm").append('<input type="hidden" name="replicationReason" value="<%:Model.ReplicationReason%>" id="hiddenReplicationReason" />');

            $("#sourceServerDDL").on("change", function () {
                $("#hiddenSourceServer").val($(this).find(":selected").val());
                spinblock();
                searchForm.submit();
            });

            $("#partitionNameDDL").on("change", function () {
                $("#hiddenPartitionName").val($(this).find(":selected").val());
                spinblock();
                searchForm.submit();
            });

            $("#replicationReasonDDL").on("change", function () {
                $("#hiddenReplicationReason").val($(this).find(":selected").val());
                spinblock();
                searchForm.submit();
            });

        });
    </script>
</asp:Content>
